/**
 * FileName: NoLinedClickSpan
 * Author: Administrator
 * Date: 2020/12/1 0001 11:24
 * Description:
 */
package sz.szsmk.citizencard.widget;

import android.content.Context;
import android.graphics.Color;
import android.os.Bundle;
import android.text.TextPaint;
import android.text.style.ClickableSpan;
import android.util.Log;
import android.view.View;

import sz.szsmk.citizencard.util.Constant;
import sz.szsmk.citizencard.util.JumpUtils;

/**
 * @ClassName: NoLinedClickSpan
 * @Description: java类作用描述
 * @Author: Administrator
 * @Date: 2020/12/1 0001 11:24
 */
public class NoLinedClickSpan extends ClickableSpan {


        String text;
        Context context;
        String url;
        String color;
        public NoLinedClickSpan(String color,String url,Context context) {
            super();
            this.context = context;
            this.url=url;
            this.color=color;
        }

        @Override
        public void updateDrawState(TextPaint ds) {
//            ds.setColor(ds.linkColor);
            ds.setColor(Color.parseColor(color));
            ds.setUnderlineText(false); //去掉下划线
        }

        @Override
        public void onClick(View widget) {


            Log.d("MainActiviy", "您点击了协议");
            String url = this.url;
            Bundle bundle =new Bundle();
            bundle.putString("url", url);
            bundle.putBoolean("isNeedGetPermission",true);
            JumpUtils.jumptoNatvie(context, "webView", 0, bundle);



        }


}